<ui:composition template="index.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

	<ui:define name="content">
		<h3 id="title-doc">Perfil</h3>

		<h:form id="form-update-profile">
			<p:messages id="message" showDetail="true" />

			<h:outputText for="update-firstName" value="Nome" />
			<p:inputText id="update-firstName"
				value="#{administratorBean.administrator.firstName}" required="true"
				validator="validaAlfaNumerico"
				requiredMessage="Favor informar o nome!">
				<h:message for="update-firstName" style="display :block; color :red"></h:message>
			</p:inputText>

			<h:outputText for="update-lastName" value="Sobrenome" />
			<p:inputText id="update-lastName"
				value="#{administratorBean.administrator.lastName}" required="true"
				validator="validaAlfaNumerico"
				requiredMessage="Favor informar o sobrenome!">
				<h:message for="new-lastName" style="display :block; color :red"></h:message>
			</p:inputText>

			<h:outputText for="update-username" value="Usuário" />
			<p:inputText id="update-username"
				value="#{administratorBean.administrator.username}" required="true"
				validator="validaAlfaNumerico"
				requiredMessage="Favor informar o Usuário!">
				<h:message for="update-username" style="display :block; color :red"></h:message>
			</p:inputText>

			<h:outputText for="update-email" value="Email" />
			<p:inputText id="update-email"
				value="#{administratorBean.administrator.email}" required="true"
				validator="validaEmail" requiredMessage="Favor informar o email">
				<h:message for="update-email" style="display :block; color :red"></h:message>
			</p:inputText>

			<p:commandButton actionListener="#{administratorBean.update}"
				oncomplete="validateForm(xhr, status, args, 'dlg-update')"
				value="Salvar" update="form-update-profile"
				process="form-update-profile" />
			<p:button value="Cancelar" />
		</h:form>

		<h4>Alterar Senha</h4>
		<h:form id="form-update-password">
			<p:messages id="message" showDetail="true" />

			<h:outputText for="update-password" value="Senha" />
			<p:password id="update-password"
				value="#{administratorBean.administrator.password}" feedback="true"
				match="update-confirmPassword" />

			<h:outputText for="update-confirmPassword" value="Confirmar Senha" />
			<p:password id="update-confirmPassword" value="" />

			<p:commandButton actionListener="#{administratorBean.update}"
				oncomplete="validateForm(xhr, status, args, 'dlg-update')"
				value="Salvar" update="form-update-password"
				process="form-update-password" />
		</h:form>
	</ui:define>

	<!-- Modals -->
	<ui:define name="modals">

	</ui:define>

</ui:composition>